

<%@ page import="grails.converters.JSON; com.app.ic.bill.IcGeneralBody" %>
<g:set var="entityName" value="${message(code: 'icGeneralBody.label', default: 'IcGeneralBody')}" />
<script>


    $(function(){


        <g:if test="${ac=='create'}">
        $('#bodyTable${pageId}').edatagrid({

            data:${icGeneralHeadInstance.body?:[] as JSON}
        });
        </g:if>
        <g:else>
        $('#bodyTable${pageId}').edatagrid({
            url:'${createLink(action: 'queryBody',params: [headId:icGeneralHeadInstance?.id])}'

        });
        </g:else>


    });


    function onAddRow${pageId}(){


        $('#bodyTable${pageId}').edatagrid('addRow');
    }

    function onDeleteRow${pageId}(){
        var row=$('#bodyTable${pageId}').datagrid('getSelected');
        var index = $('#bodyTable${pageId}').datagrid('getRowIndex',row);
        if(row==null){
            $.messager.show({
                title:'消息',
                msg:'请选择需要删除的数据！'
            });
            return;
        };
        $('#bodyTable${pageId}').datagrid('deleteRow',index);
    }





</script>


<div id="tbb${pageId}">
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true"  onclick="onAddRow${pageId}() " data-options="disabled:${soSaleInstance?.sourceBillTypeCode!=null}" >
        ${message(code: 'default.button.create.label',default: '增加')}
    </a>

    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="onDeleteRow${pageId}() " data-options="disabled:${soSaleInstance?.sourceBillTypeCode!=null}">
        ${message(code: 'default.button.delete.label',default: '删除')}
    </a>
</div>


%{--表格--}%
<table id="bodyTable${pageId}"
       rownumbers="true"
       fit="true" toolbar="#tbb${pageId}" singleSelect="true" >

    <thead>

    <tr>

        <g:refTemplate code="refBdInvmandoc"  inForm="false" model="[required:false,field:'bdInvmandoc',title:g.message(code: 'icGeneralBody.bdInvmandoc.label', default: '存货')]"></g:refTemplate>

        <g:refTemplate code="refBdMeasdoc"  inForm="false" model="[required:false,field:'astunit',title:g.message(code: 'icGeneralBody.astunit.label', default: '辅计量单位')]"></g:refTemplate>


        %{--<th field="dbizDate" sortable="false" editor="datebox" width="80">${message(code: 'icGeneralBody.dbizDate.label', default: 'Dbiz Date')}</th>--}%


        %{--<th field="dstandbyDate" sortable="false" editor="datebox" width="80">${message(code: 'icGeneralBody.dstandbyDate.label', default: 'Dstandby Date')}</th>--}%


        %{--<th field="dvaliDate" sortable="false" editor="datebox" width="80">${message(code: 'icGeneralBody.dvaliDate.label', default: 'Dvali Date')}</th>--}%


        %{--<th field="fchecked" sortable="false" editor="text" width="80">${message(code: 'icGeneralBody.fchecked.label', default: 'Fchecked')}</th>--}%


        <th field="hsl" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80"><g:message code="icgeneralbody.hsl.label" /></th>

        %{--<th field="inDate" sortable="false" editor="datebox" width="80">${message(code: 'icGeneralBody.inDate.label', default: 'In Date')}</th>--}%

        %{--<th field="nbarcodenum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nbarcodenum.label', default: 'Nbarcodenum')}</th>--}%

        %{--<th field="ncountNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.ncountNum.label', default: 'Ncount Num')}</th>--}%

        %{--<th field="ninNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.ninNum.label', default: 'Nin Num')}</th>--}%

        %{--<th field="ninassistNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.ninassistNum.label', default: 'Ninassist Num')}</th>--}%

        %{--<th field="ningrossNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.ningrossNum.label', default: 'Ningross Num')}</th>--}%

        %{--<th field="nkdNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nkdNum.label', default: 'Nkd Num')}</th>--}%

        %{--<th field="nmny" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nmny.label', default: 'Nmny')}</th>--}%

        %{--<th field="nneedinassistNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nneedinassistNum.label', default: 'Nneedinassist Num')}</th>--}%

        <th field="noutNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80"><g:message code='icGeneralBody.noutNum.label'></g:message></th>

        <th field="noutassistNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80"><g:message code='icGeneralBody.noutassistNum.label'></g:message></th>

        %{--<th field="noutgrossNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.noutgrossNum.label', default: 'Noutgross Num')}</th>--}%

        %{--<th field="nprice" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nprice.label', default: 'Nprice')}</th>--}%

        %{--<th field="nreplenishedNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nreplenishedNum.label', default: 'Nreplenished Num')}</th>--}%

        %{--<th field="nreplenishedastNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nreplenishedastNum.label', default: 'Nreplenishedast Num')}</th>--}%

        %{--<th field="nshouldinNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nshouldinNum.label', default: 'Nshouldin Num')}</th>--}%

        <th field="nshouldoutNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80"><g:message code='icGeneralBody.nshouldoutNum.label'></g:message></th>

        %{--<th field="nshouldoutassistNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.nshouldoutassistNum.label', default: 'Nshouldoutassist Num')}</th>--}%

        %{--<th field="ntareNum" sortable="false" editor="{type:'numberbox',options:{precision:2,required:true}}" width="80">${message(code: 'icGeneralBody.ntareNum.label', default: 'Ntare Num')}</th>--}%

        <th field="outDate" sortable="false" editor="datebox" width="80"><g:message code='icGeneralBody.outDate.label'></g:message></th>


        %{--<th field="pkReturnreason" sortable="false" editor="text" width="80">${message(code: 'icGeneralBody.pkReturnreason.label', default: 'Pk Returnreason')}</th>--}%

        <th field="vreceiveaddress" sortable="false" editor="text" width="80"> <g:message code="icgeneralbody.vreceiveaddress.label" ></g:message></th>


        %{--<th field="vbatchcode" sortable="false" editor="text" width="80">${message(code: 'icGeneralBody.vbatchcode.label', default: 'Vbatchcode')}</th>--}%

        <th field="vnotebody" sortable="false" editor="text" width="180"><g:message code="icgeneralbody.vnotebody.labe" /></th>


        %{--<th field="vtransfercode" sortable="false" editor="text" width="80">${message(code: 'icGeneralBody.vtransfercode.label', default: 'Vtransfercode')}</th>--}%

        %{--<th field="vvehiclecode" sortable="false" editor="text" width="80">${message(code: 'icGeneralBody.vvehiclecode.label', default: 'Vvehiclecode')}</th>--}%

    </tr>
    </thead>
</table>



